Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cspell/cspell-types

Package Overview
Dependencies
Maintainers
1
Versions
243
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cspell/cspell-types

Types for cspell and cspell-lib

  • 6.31.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
314K
decreased by-58.65%
Maintainers
1
Weekly downloads
 
Created

What is @cspell/cspell-types?

@cspell/cspell-types is a TypeScript library that provides type definitions for the CSpell spelling checker configuration. It allows developers to define and manage spelling configurations programmatically, ensuring that their spelling rules are consistent and easily maintainable.

What are @cspell/cspell-types's main functionalities?

Define CSpell Configuration

This feature allows you to define a CSpell configuration using TypeScript. You can specify the language, custom words, paths to ignore, and dictionaries to use.

{
  "import { CSpellUserSettings } from '@cspell/cspell-types';

  const config: CSpellUserSettings = {
    language: 'en',
    words: ['typescript', 'npm'],
    ignorePaths: ['node_modules', 'dist'],
    dictionaries: ['softwareTerms']
  };

  console.log(config);"
}

Extend Existing Configuration

This feature demonstrates how to extend an existing CSpell configuration. You can merge configurations to add new words or ignore paths while keeping the base configuration intact.

{
  "import { CSpellUserSettings } from '@cspell/cspell-types';

  const baseConfig: CSpellUserSettings = {
    language: 'en',
    words: ['typescript']
  };

  const extendedConfig: CSpellUserSettings = {
    ...baseConfig,
    words: [...baseConfig.words, 'npm'],
    ignorePaths: ['node_modules']
  };

  console.log(extendedConfig);"
}

Validate Configuration

This feature allows you to validate a CSpell configuration to ensure it meets the required schema. The `validateConfig` function checks the configuration and returns any validation errors.

{
  "import { CSpellUserSettings, validateConfig } from '@cspell/cspell-types';

  const config: CSpellUserSettings = {
    language: 'en',
    words: ['typescript', 'npm'],
    ignorePaths: ['node_modules', 'dist'],
    dictionaries: ['softwareTerms']
  };

  const validationResult = validateConfig(config);
  console.log(validationResult);"
}

Other packages similar to @cspell/cspell-types

Keywords

FAQs

Package last updated on 08 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc